package org.test.javaCharacteristic.inherit;

import org.junit.Test;

/**
 * 继承时的执行顺序问题
 * @author game
 *
 */
public class InheritFather {

	// 成员变量,
	
	private PrintF t1  = new PrintF("父类的变量定义");
	private static PrintF t = new PrintF("父类的静态变量定义");

	
	public InheritFather() {

		System.out.println("父类构造函数");
	}
	
	
	public static void  main(String arg[]){
//		System.out.println("以下为顺序:");
		new InheritChild();
		
	}
}

class InheritChild extends InheritFather{
	
	private PrintF t1  = new PrintF("子类的变量定义");
	private static PrintF t = new PrintF("子类静态变量定义");
	
	public InheritChild(){
		
		System.out.println("子类构造函数 ");
	}
	
}

class PrintF{

	public PrintF(String s) {
		super();
		System.out.println(s);
		// TODO Auto-generated constructor stub
	}
	
}
